Tweet

data class Tweet(id: String?, text: String?)

Tweets are the basic building block of all things Twitter. The Tweet object has a long list of ‘root-level’ fields, such as id, text, and created_at. Tweet objects are also the ‘parent’ object to several child objects including user, media, poll, and place. Use the field parameter tweet.fields when requesting these root-level fields on the Tweet object.

The Tweet object that can be found and expanded in the user resource. Additional Tweets related to the requested Tweet can also be found and expanded in the Tweet resource. The object is available for expansion with ?expansions=pinned_tweet_id in the user resource or ?expansions=referenced_tweets.id in the Tweet resource to get the object with only default fields. Use the expansion with the field parameter: tweet.fields when requesting additional fields to complete the object.

Constructors

Link copied to clipboard
fun Tweet(id: String? = null, text: String? = null)

Types

Link copied to clipboard
data class Attachments(pollIds: ArrayList<String>?, mediaKeys: ArrayList<String>?)
Link copied to clipboard
class ContextAnnotations
Link copied to clipboard
class Entities
Link copied to clipboard
data class Geo(coordinates: Tweet.Geo.Coordinates?, placeId: String?)
Link copied to clipboard
data class NonPublicMetrics(impressionCount: Long, urlLinkClicks: Long, userProfileClicks: Long?)
Link copied to clipboard
data class OrganicMetrics(impressionCount: Long, likeCount: Long, replyCount: Long, retweetCount: Long, urlLinkClicks: Long, userProfileClicks: Long?)
Link copied to clipboard
data class PromotedMetrics(likeCount: Long, replyCount: Long, retweetCount: Long, impressionCount: Long, urlLinkClicks: Long, userProfileClicks: Long?)
Link copied to clipboard
data class PublicMetrics(likeCount: Long, replyCount: Long, retweetCount: Long, quoteCount: Long)
Link copied to clipboard
data class ReferencedTweets(type: String?, id: String?)
Link copied to clipboard
data class Withheld(copyright: Boolean)

Properties

Link copied to clipboard
@SerializedName(value = "attachments")
var attachments: Tweet.Attachments? = null

Specifies the type of attachments (if any) present in this Tweet.

Link copied to clipboard
@SerializedName(value = "author_id")
var authorId: String? = null

The unique identifier of the User who posted this Tweet.

Link copied to clipboard
@SerializedName(value = "context_annotations")
var contextAnnotations: ArrayList<Tweet.ContextAnnotations>? = null

Contains context annotations for the Tweet.

Link copied to clipboard
@SerializedName(value = "conversation_id")
var conversationId: String? = null

The Tweet ID of the original Tweet of the conversation (which includes direct replies, replies of replies).

Link copied to clipboard
@SerializedName(value = "created_at")
var createdAt: String? = null

Creation time of the Tweet.

Link copied to clipboard
@SerializedName(value = "entities")
var entities: Tweet.Entities? = null

Entities which have been parsed out of the text of the Tweet. Additionally see entities in Twitter Objects.

Link copied to clipboard
@SerializedName(value = "geo")
var geo: Tweet.Geo? = null

Contains details about the location tagged by the user in this Tweet, if they specified one. e.g.

Link copied to clipboard
@SerializedName(value = "id")
var id: String? = null

The unique identifier of the requested Tweet.

Link copied to clipboard
@SerializedName(value = "in_reply_to_user_id")
var inReplyToUserId: String? = null

If the represented Tweet is a reply, this field will contain the original Tweet’s author ID. This will not necessarily always be the user directly mentioned in the Tweet.

Link copied to clipboard
@SerializedName(value = "lang")
var lang: String? = null

Language of the Tweet, if detected by Twitter. Returned as a BCP47 language tag.

Link copied to clipboard
@SerializedName(value = "non_public_metrics")
var nonPublicMetrics: Tweet.NonPublicMetrics? = null

Non-public engagement metrics for the Tweet at the time of the request. Requires user context authentication.

Link copied to clipboard
@SerializedName(value = "organic_metrics")
var organicMetrics: Tweet.OrganicMetrics? = null

Engagement metrics, tracked in an organic context, for the Tweet at the time of the request. Requires user context authentication.

Link copied to clipboard
@SerializedName(value = "possibly_sensitive")
var possiblySensitive: Boolean = false

This field only surfaces when a Tweet contains a link. The meaning of the field doesn’t pertain to the Tweet content itself, but instead it is an indicator that the URL contained in the Tweet may contain content or media identified as sensitive content.

Link copied to clipboard
@SerializedName(value = "promoted_metrics")
var promotedMetrics: Tweet.PromotedMetrics? = null

Engagement metrics, tracked in a promoted context, for the Tweet at the time of the request. Requires user context authentication.

Link copied to clipboard
@SerializedName(value = "public_metrics")
var publicMetrics: Tweet.PublicMetrics? = null

Public engagement metrics for the Tweet at the time of the request.

Link copied to clipboard
@SerializedName(value = "referenced_tweets")
var referencedTweets: ArrayList<Tweet.ReferencedTweets>? = null

A list of Tweets this Tweet refers to. For example, if the parent Tweet is a Retweet, a Retweet with comment (also known as Quoted Tweet) or a Reply, it will include the related Tweet referenced to by its parent.

Link copied to clipboard
@SerializedName(value = "reply_settings")
var replySettings: String? = null

Shows you who can reply to a given Tweet. Fields returned are "everyone", "mentioned_users", and "followers".

Link copied to clipboard
@SerializedName(value = "source")
var source: String? = null

The name of the app the user Tweeted from.

Link copied to clipboard
@SerializedName(value = "text")
var text: String? = null

The actual UTF-8 text of the Tweet. See twitter-text for details on what characters are currently considered valid.

Link copied to clipboard
@SerializedName(value = "withheld")
var withheld: Tweet.Withheld? = null

When present, contains withholding details for withheld content.